﻿using MauiApp5.ViewModels;

namespace MauiApp5
{
    public partial class App : Application
    {
        public App()
        {
            InitializeComponent();
            MainPage = new AppShell();

            Services = ConfigureServices();
        }

        /// <summary>
        /// Gets the current <see cref="App"/> instance in use
        /// </summary>
        public new static App Current => (App)Application.Current;

        /// <summary>
        /// Gets the <see cref="IServiceProvider"/> instance to resolve application services.
        /// </summary>
        public IServiceProvider Services { get; }

        /// <summary>
        /// Configures the services for the application.
        /// </summary>
        private static IServiceProvider ConfigureServices()
        {
            var services = new ServiceCollection();


            //services.AddSingleton<IEmailService, EmailService>();
            services.AddTransient<Newpage1ViewMode>();
            services.AddTransient<UserXViewModels>();
            services.AddTransient<RecentActivityPageViewModel>();


            return services.BuildServiceProvider();
        }
    }
}
